package com.leinao.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * description
 *
 * @author zhong.wang
 * @date 2025/1/16
 */
@Data
public class PointInfo implements Serializable,Cloneable {

    private Long id;

    private Long deviceId;

    private String pointNum;

    private String pointType;

    private String pointUnit;

    private Long regularPointId;

    private String pointName;

    private String regularPointName;

    private Long stationId;

    private Long stationAreaId;

    /**
     * 超级表的名字
     */
    private String superTableName;

    /**
     * 子表的名称
     */
    private String childTableName;

    /**
     * 测点值
     */
    private Double dataValue;

    /**
     * 时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ts;

    @Override
    public Object clone() {
        // 调用父类的clone方法，进行浅拷贝
        PointInfo cloned = null;
        try {
            cloned = (PointInfo) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }

        // 如果有需要深度复制的对象，则在此处处理
        // 注意：对于transient字段，由于它们不会被序列化，因此需要特别处理

        return cloned;
    }
}
